package com.houweishi.module.type.service.impl;

import java.util.List;
import com.houweishi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.houweishi.module.type.mapper.BizApprovalTypeMapper;
import com.houweishi.module.type.domain.BizApprovalType;
import com.houweishi.module.type.service.IBizApprovalTypeService;

/**
 * 审批模板Service业务层处理
 * 
 * @author houweishi
 * @date 2023-02-21
 */
@Service
public class BizApprovalTypeServiceImpl implements IBizApprovalTypeService 
{
    @Autowired
    private BizApprovalTypeMapper bizApprovalTypeMapper;

    /**
     * 查询审批模板
     * 
     * @param id 审批模板主键
     * @return 审批模板
     */
    @Override
    public BizApprovalType selectBizApprovalTypeById(Long id)
    {
        return bizApprovalTypeMapper.selectBizApprovalTypeById(id);
    }

    /**
     * 查询审批模板列表
     * 
     * @param bizApprovalType 审批模板
     * @return 审批模板
     */
    @Override
    public List<BizApprovalType> selectBizApprovalTypeList(BizApprovalType bizApprovalType)
    {
        return bizApprovalTypeMapper.selectBizApprovalTypeList(bizApprovalType);
    }

    /**
     * 新增审批模板
     * 
     * @param bizApprovalType 审批模板
     * @return 结果
     */
    @Override
    public int insertBizApprovalType(BizApprovalType bizApprovalType)
    {
        bizApprovalType.setCreateTime(DateUtils.getNowDate());
        return bizApprovalTypeMapper.insertBizApprovalType(bizApprovalType);
    }

    /**
     * 修改审批模板
     * 
     * @param bizApprovalType 审批模板
     * @return 结果
     */
    @Override
    public int updateBizApprovalType(BizApprovalType bizApprovalType)
    {
        bizApprovalType.setUpdateTime(DateUtils.getNowDate());
        return bizApprovalTypeMapper.updateBizApprovalType(bizApprovalType);
    }

    /**
     * 批量删除审批模板
     * 
     * @param ids 需要删除的审批模板主键
     * @return 结果
     */
    @Override
    public int deleteBizApprovalTypeByIds(Long[] ids)
    {
        return bizApprovalTypeMapper.deleteBizApprovalTypeByIds(ids);
    }

    /**
     * 删除审批模板信息
     * 
     * @param id 审批模板主键
     * @return 结果
     */
    @Override
    public int deleteBizApprovalTypeById(Long id)
    {
        return bizApprovalTypeMapper.deleteBizApprovalTypeById(id);
    }
}
